//
//  WBEmoticonButton.m
//  sinaWeibo
//
//  Created by 李江波 on 2016/11/24.
//  Copyright © 2016年 lijiangbo. All rights reserved.
//

#import "WBEmoticonButton.h"
#import "WBEmoticonManager.h"

@implementation WBEmoticonButton

-(void)setEmoticon:(WBEmoticon *)emoticon{

    _emoticon = emoticon;
    
    NSBundle *bundle = [WBEmoticonManager shared].emoticonBundle;
    if (emoticon.type) {
        //为1是emoji表情
        [self setTitle:emoticon.emojiStr forState:UIControlStateNormal];
        [self setImage:nil forState:UIControlStateNormal];
        
    }else{
        
        UIImage *img = [UIImage imageNamed:emoticon.imagePath inBundle:bundle compatibleWithTraitCollection:nil];
        [self setImage:img forState:UIControlStateNormal];
        [self setTitle:nil forState:UIControlStateNormal];
    }

}

@end
